﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <link rel="stylesheet" href="/static/css/angularStyle.css" />
    <link rel="stylesheet" href="/static/css/common/reset.css" />
    <link rel="stylesheet" href="/static/css/associate.css" />
    <link rel="stylesheet" href="/static/css/ng-pagination.min.css" />
    <link rel="stylesheet" href="/static/css/sweetalert.min.css" />
    <title>宾果高校</title>
</head>
<body>
    <div class="associate">
        <div id="divHeader"></div>
        <section class="assoc-content container clearfix">
            <div class="assoc-c-left fl">
                <div id="divNavigation"></div>
            </div>
            <div class="assoc-c-right fr" ng-app="myApp">
                <p class="f14">消息中心</p>
                <ul class="assoc-crs-tab clearfix mt30">
                    <li class="active">系统通知</li>
                    <!--<li>查看私信</li>
                    <li>发出的私信</li>
                    <li>发私信</li>-->
                </ul>
                <div class="assoc-crs-content mt20" ng-cloak ng-controller="messageCtrl">
                    <div class="assoc-crsc-title borderbtm clearfix" ng-model="count">
                        <p class="">共收到{{count}}条系统通知</p>
                        <p>发布时间</p>
                    </div>
                    <table class="assoc-cru-content mt10">
                        <tbody class="assoc-cruc-tab">
                            <tr class="assoc-cru-list clearfix noticeInform" ng-repeat="x in names">
                                <td width="10%">系统通知</td>
                                <td width="57%">{{x.Content}}</td>
                                <td width="33%" style="text-align: left;">{{x.SendTime | date:'yyyy/MM/dd hh:MM:ss'}} <a href="javascript:void(0)" tag="{{x.ID}}" onclick="UpdateMessage(this, 'Deleted')" class="assoc-crul-delete ml30"></a></td>
                            </tr>
                        </tbody>
                    </table>
                    <div class="page">
                        <div class="center">
                            <pager page-count="pageCount" current-page="currentPage" on-page-change="onPageChange()" first-text="首页" next-text="下一页" prev-text="上一页" last-text="尾页"></pager>
                        </div>
                    </div>
                </div>
            </div>
        </section>
    </div>
    <div id="divFooter"></div>
</body>
</html>

<script type="text/javascript" src="/static/js/ref/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="/static/js/self/common.js"></script>
<script type="text/javascript" src="/static/js/ref/angular.min.js"></script>
<script type="text/javascript" src="/static/js/ref/ng-pagination.min.js"></script>
<script type="text/javascript" src="/static/js/ref/sweetalert.min.js"></script>
<script>

    var userType = common.GetUserType();
    if (!common.checkValue(userType))
        window.location = "/login.html";

    $("#divHeader").load("/wuc/header.html");
    $("#divFooter").load("/wuc/footer.html");
    $("#divNavigation").load("/wuc/navigation.html");

    var values = {};
    values.Limit = 10;
    values.Start = 1;

    common.CreatePagingCtrl({ url: '/api/project/ListMyMessages', name: 'messageCtrl', pars: values, objType: 'json' });

    function UpdateMessage(obj, type) {
        var pars = {};
        pars.id = $(obj).attr("tag");
        pars.type = type;
        common.commonAjax({ type: 'Post', url: '/api/project/UpdateMessage', data: pars, sMethod: AfterCompleted });
    }

    function AfterCompleted(ctx) {
        if (ctx == null) {
            common.alertMessage("无数据.");
            return;
        }

        common.showMessage("操作成功.", function () { window.location = "systemNotice.html"; });
    }

</script>